Flow control techniques seek to efficiently organize the transmission of data packets between a producer device and a consumer device located on two distinct nodes of a shared asynchronous transmission channel, e.g. a network.
Within the context of a credit-based flow control, a consumer has a buffer memory or input queue for each producer, which stores packets awaiting consumption. Each producer has a credit counter that starts at the size, in number of packets, of the input queue of the consumer.
At each packet transmission, the producer decrements counter. It stops transmission when its counter reaches zero.
Transmitted packets arrive in the input queue of the consumer. The latter, after consuming as number or packets in its queue, returns to the producer a credit indicative of the available space in the queue. Upon receiving the credit, the producer increments its counter by the corresponding number, which allows, it to continue the transmission of packets.
Optimizations of technique may consist in adjusting the threshold for sending credits so that the producer receives the credits before its counter reaches zero, while their number does not congest the reverse transmission channel.
Such a flow control is used, for example, in the so-called “PCI-Express” bus.
A credit-based technique is typically used in situations where the bandwidth of the transmission channel is small compared to the processing capacity of the producers and consumers, e.g. in the context of a macroscopic network. This means that a consumer is able to empty its input queue faster than it can be filled by the transmission channel, and that the producer is able to fill an output queue in less time than it takes to empty by the transmission channel. In this situation, the packet structure has little importance because producers and consumers have sufficient resources between two packet transmissions to implement format conversions, if required.
In a network-on-chip, the network bandwidth may match the capacity of the producers and consumers. It may then be appropriate to take account of the word sizes used by the consumer and the producer, whereby a same packet may be formed of different word sizes, depending on whether it is seen by the producer or the consumer. Counting credits in numbers of packets may then be inappropriate.